<extend name="public@base5"/>
<block name="main">
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link" href="{:url('UserMine/index')}">{:lang('ADMIN_USER_INDEX')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('User/add')}">{:lang('ADMIN_USER_ADD')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link active">{:lang('ADMIN_USER_EDIT')}</a>
            </li>
        </ul>
        <form method="post" class="js-ajax-form margin-top-20" action="{:url('UserMine/editPost')}">
            <div class="row mb-3">
				<label for="input-user_nickname" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>用户姓名</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_nickname" name="user_nickname" value="{$user_nickname}" maxlength="10">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_login" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>登陆账户</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_login" name="user_login" value="{$user_login}" maxlength="30">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_pass" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>登录密码</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_pass" name="user_pass" value="" placeholder="******" maxlength="8">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_email" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>用户邮箱</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_email" name="user_email" value="{$user_email}">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_email" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>所属角色</label>
				<div class="col-md-8 col-sm-10">
					<select class="form-control form-check-inline col-12" name="role_id" style="width: 140px;">
                        <foreach name="roles" item="vo">
                            <php>
                                $disabled='';
                                if(cmf_get_current_admin_id() != 1 && $vo['id'] == 1){
                                $disabled='disabled';
                                }
                                if(!in_array($vo['id'],$role_ids)){
                                continue;
                                }
                                $role_id_selected=in_array($vo['id'],$role_ids)?"selected":"";
                            </php>
                            <option value="{$vo.id}" {$role_id_selected}>{$vo.name}</option>
                        </foreach>
                    </select> &nbsp;
				</div>
			</div>
            <div class="row mb-3">
                <div class="offset-md-2 col-sm-10">
                    <input type="hidden" name="id" value="{$id}"/>
                    <button type="submit" class="btn btn-primary js-ajax-submit">
                        <i class="fa fa-save fa-fw"></i> {:lang('SAVE')}
                    </button>
                    <a class="btn btn-secondary" href="javascript:history.back(-1);">{:lang('BACK')}</a>
                </div>
            </div>
        </form>
    </div>
</block>
